package xyz.xtt.user.api.enums;

import java.util.Arrays;
import java.util.Objects;

public enum UserFundRecordType {
    ORDER(0, "支付交易记录"),
    WITHDRAW(1, "提现记录");
    private final int code;
    private final String description;
    private UserFundRecordType(int code, String description)
    {
        this.code = code;
        this.description = description;
    }
    public int getCode()
    {
        return code;
    }
    public UserFundRecordType getByCode(int code)
    {
        return Arrays.stream(values())
                .filter(type -> Objects.equals(type.getCode(), code))
                .findFirst().orElse(null);
    }
}
